package com.webchat.admin.controller;


import com.webchat.admin.service.WalletManagementService;
import com.webchat.common.bean.APIPageResponseBean;
import com.webchat.common.config.annotation.ValidatePermission;
import com.webchat.domain.vo.response.UserWalletDetailResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin-service/wallet")
public class WalletManagementController {

    @Autowired
    private WalletManagementService walletManagementService;

    @ValidatePermission
    @GetMapping("/page")
    public APIPageResponseBean<UserWalletDetailResponseVO> page(
            @RequestParam(value = "transType", required = false) Integer transType,
            @RequestParam(value = "eventType", required = false) Integer eventType,
            @RequestParam(value = "userId", required = false) String userId,
            @RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
            @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {

        return walletManagementService.page(transType, eventType, userId, pageNo, pageSize);
    }

}
